﻿<UserControl x:Class="Vtron.HipcConfigurationTools.DecodeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008">
    <UserControl.Resources>
        <ControlTemplate x:Key="ErrorTemplate">
            <Border BorderBrush="Red" BorderThickness="2">
                <AdornedElementPlaceholder />
            </Border>
        </ControlTemplate>
    </UserControl.Resources>

    <Grid Background="{x:Null}" Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <ScrollViewer VerticalAlignment="Top" HorizontalAlignment="Stretch" VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Top" BorderThickness="0,0,0,0">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <StackPanel HorizontalAlignment="Stretch" Width="Auto">
                    <Expander IsExpanded="True" Header="{Binding OrderDetails}" Content="{Binding OrderDetails}">
                        <Expander.ContentTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <TextBox IsEnabled="False" Width="300" Height="100" Margin="10,0,10,0"/>
                                    <Button Grid.Row="1" Content="查询" Command="{Binding SearchVersionCommand}" Template="{StaticResource OnlySubmitButtonTemplate}" Cursor="Hand" HorizontalAlignment="Center" Margin="10"/>
                                </Grid>
                            </DataTemplate>
                        </Expander.ContentTemplate>
                        <Expander.HeaderTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" x:Name="StockHeader" Margin="0,5,0,0" Style="{StaticResource TextBlockSectionTitle}" Text="版本信息查询"/>
                                </Grid>
                            </DataTemplate>
                        </Expander.HeaderTemplate>
                    </Expander>
                    <Rectangle Margin="0,5,0,0" Stroke="{x:Null}" RadiusX="0" RadiusY="0" VerticalAlignment="Bottom" Height="4" RenderTransformOrigin="0.5,0.5">
                        <Rectangle.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="1" ScaleY="-1"/>
                                <SkewTransform AngleX="0" AngleY="0"/>
                                <RotateTransform Angle="0"/>
                                <TranslateTransform X="0" Y="0"/>
                            </TransformGroup>
                        </Rectangle.RenderTransform>
                    </Rectangle>
                </StackPanel>

                <StackPanel HorizontalAlignment="Stretch" Width="Auto" Grid.Row="1">
                    <Expander IsExpanded="True" Header="{Binding OrderDetails}" Content="{Binding OrderDetails}">
                        <Expander.ContentTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <Grid  HorizontalAlignment="Center" Margin="10">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="35"/>
                                            <RowDefinition Height="35"/>
                                            <RowDefinition Height="35"/>
                                            <RowDefinition Height="35"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="IP地址:" Foreground="#FF444444" VerticalAlignment="Center" Width="Auto" Height="Auto" HorizontalAlignment="Right" Grid.ColumnSpan="1" Margin="5,0,0,0" />
                                        <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=Ip, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" HorizontalAlignment="Left" Width="120" Height="Auto" VerticalAlignment="Center" Margin="5,0,0,0" />
                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="子网掩码:" Foreground="#FF444444" VerticalAlignment="Center" Width="Auto" Height="Auto" HorizontalAlignment="Right" Grid.ColumnSpan="1" Margin="5,0,0,0" />
                                        <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=Mask, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" HorizontalAlignment="Left" Width="120" Height="Auto" VerticalAlignment="Center" Margin="5,0,0,0" />
                                        <TextBlock Grid.Row="2" Grid.Column="0" Text="默认网关:" Foreground="#FF444444" VerticalAlignment="Center" Width="Auto" Height="Auto" HorizontalAlignment="Right" Grid.ColumnSpan="1" Margin="5,0,0,0" />
                                        <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Path=Gateway, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" HorizontalAlignment="Left" Width="120" Height="Auto" VerticalAlignment="Center" Margin="5,0,0,0" />
                                        <TextBlock Grid.Row="3" Grid.Column="0" Text="MAC地址:" Foreground="#FF444444" VerticalAlignment="Center" Width="Auto" Height="Auto" HorizontalAlignment="Right" Grid.ColumnSpan="1" Margin="5,0,0,0" />
                                        <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding Path=Mac, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" HorizontalAlignment="Left" Width="120" Height="Auto" VerticalAlignment="Center" Margin="5,0,0,0" />
                                    </Grid>
                                    <Grid Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="10,0,10,0">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="30"/>
                                            <RowDefinition Height="30"/>
                                        </Grid.RowDefinitions>
                                        <Button Grid.Row="0" Content="获取" Command="{Binding SearchNetConfigCommand}" Template="{StaticResource OnlySubmitButtonTemplate}" HorizontalAlignment="Center" Cursor="Hand" Height="25"/>
                                        <Button Grid.Row="1" Content="设置" Command="{Binding SumbitNetConfigCommand}" Template="{StaticResource OnlySubmitButtonTemplate}" HorizontalAlignment="Center" Cursor="Hand" Height="25"/>
                                    </Grid>
                                </Grid>
                            </DataTemplate>
                        </Expander.ContentTemplate>
                        <Expander.HeaderTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" x:Name="StockHeader" Margin="0,5,0,0" Style="{StaticResource TextBlockSectionTitle}" Text="网络参数"/>
                                </Grid>
                            </DataTemplate>
                        </Expander.HeaderTemplate>
                    </Expander>
                    <Rectangle Margin="0,5,0,0" Stroke="{x:Null}" RadiusX="0" RadiusY="0" VerticalAlignment="Bottom" Height="4" RenderTransformOrigin="0.5,0.5">
                        <Rectangle.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="1" ScaleY="-1"/>
                                <SkewTransform AngleX="0" AngleY="0"/>
                                <RotateTransform Angle="0"/>
                                <TranslateTransform X="0" Y="0"/>
                            </TransformGroup>
                        </Rectangle.RenderTransform>
                    </Rectangle>
                </StackPanel>

                <StackPanel HorizontalAlignment="Stretch" Width="Auto" Grid.Row="2">
                    <Expander IsExpanded="True" Header="{Binding OrderDetails}" Content="{Binding OrderDetails}">
                        <Expander.ContentTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="30"/>
                                        <RowDefinition Height="30"/>
                                    </Grid.RowDefinitions>
                                    <Button Grid.Row="0" Content="导出日志" Command="{Binding ExportLogCommand}" Template="{StaticResource OnlySubmitButtonTemplate}" HorizontalAlignment="Center" Cursor="Hand" Height="25"/>
                                    <Button Grid.Row="1" Content="单板复位" Command="{Binding RebootCommand}" Template="{StaticResource OnlySubmitButtonTemplate}" HorizontalAlignment="Center" Cursor="Hand" Height="25"/>

                                </Grid>
                            </DataTemplate>
                        </Expander.ContentTemplate>
                        <Expander.HeaderTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" x:Name="StockHeader" Margin="0,5,0,0" Style="{StaticResource TextBlockSectionTitle}" Text="其他功能"/>
                                </Grid>
                            </DataTemplate>
                        </Expander.HeaderTemplate>
                    </Expander>
                    <Rectangle Margin="0,5,0,0" Stroke="{x:Null}" RadiusX="0" RadiusY="0" VerticalAlignment="Bottom" Height="4" RenderTransformOrigin="0.5,0.5">
                        <Rectangle.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="1" ScaleY="-1"/>
                                <SkewTransform AngleX="0" AngleY="0"/>
                                <RotateTransform Angle="0"/>
                                <TranslateTransform X="0" Y="0"/>
                            </TransformGroup>
                        </Rectangle.RenderTransform>
                    </Rectangle>
                </StackPanel>
                
                
            </Grid>
        </ScrollViewer>
        <!--<StackPanel Height="Auto" VerticalAlignment="Bottom" Orientation="Horizontal" Grid.RowSpan="1" HorizontalAlignment="Center" Grid.Row="1" Margin="5">
            <Button Name="CancelAllButton" Command="{Binding CancelCommand}" Template="{StaticResource OnlyCancelButtonTemplate}" Cursor="Hand" Height="25">取消</Button>
        </StackPanel>-->
    </Grid>
</UserControl>